import Mock from 'mockjs'

export function mockNews(){
    const news  = []
    for (let i = 0; i < 10; i++) {
        news.push(Mock.mock({
        id:Mock.mock('@integer(100000,999999)'),
        type:Mock.mock('@integer(1,4)'),
        title: Mock.mock('@ctitle(6,10)'),
        time: Mock.mock('@now'),
        desc: Mock.mock('@csentence'),
        bgimg: Mock.mock('@image')
       }))
    }
    return news
}

export function mockSubjects(){
	const subjects = []
	for (let i=0; i<10; i++){
	    subjects.push(Mock.mock({
	        id:Mock.mock('@integer(100000,999999)'),
			title: Mock.mock('@ctitle(2,5)'),//.random.ctitle(2,5),
	        time: Mock.mock('@now'),//.random.datetime(),
	        desc: Mock.mock('@csentence'),//.random.csentence()
			bgcolor: Mock.mock('@color')
	    }))
	}
	return subjects
}
 
export function mockTypeNews(type){
	const typeNews = []
	for (let i=0; i<10; i++){
	    typeNews.push(Mock.mock({
	        id:Mock.mock('@integer(100000,999999)'),
			type:type,
			title: Mock.mock('@ctitle(6,10)'),
	        time: Mock.mock('@now'),
	        desc: Mock.mock('@csentence'),
			bgimg: Mock.mock('@image')
	    }))
	}
	return typeNews
}
